'\" te
.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH CTWATCH 1 "Jul 14, 2004"
.SH NAME
ctwatch \- watch events in a contract or group of contracts
.SH SYNOPSIS
.LP
.nf
\fB/usr/bin/ctwatch\fR [\fB-f\fR] [\fB-r\fR] [\fB-v\fR] \fIcontract-type\fR... | \fIcontract-id\fR...
.fi

.SH DESCRIPTION
.sp
.LP
The \fBctwatch\fR utility allows a user to observe the events occurring within
a set of contracts or contract types. By default, \fBctwatch\fR watches all
contracts.
.SH OPTIONS
.sp
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-f\fR\fR
.ad
.RS 6n
Report events starting at the front of the event queue. Normally, \fBctwatch\fR
reports only events which occur after it has been invoked. With the \fB-f\fR
option, any events that still exist in the contracts' event queues when
\fBctwatch\fR is invoked (for example, unacknowledged critical events) are also
reported.
.RE

.sp
.ne 2
.na
\fB\fB-r\fR\fR
.ad
.RS 6n
Reliably watches all messages. Normally, the system may drop informative events
and acknowledged critical events at any time, so \fBctwatch\fR isn't guaranteed
to see them all. This option may only be used if the \fBctwatch\fR is invoked
with the \fB{PRIV_CONTRACT_EVENT}\fR privilege asserted in its effective set.
.RE

.sp
.ne 2
.na
\fB\fB-v\fR\fR
.ad
.RS 6n
Request verbose event descriptions.
.RE

.SH OPERANDS
.sp
.LP
The following operands are supported:
.sp
.ne 2
.na
\fB\fIcontract-type\fR\fR
.ad
.RS 17n
Valid contract types are:
.sp
.ne 2
.na
\fBprocess\fR
.ad
.RS 11n
Process contracts.
.RE

.RE

.sp
.ne 2
.na
\fB\fIcontract-id\fR\fR
.ad
.RS 17n
A valid contract id.
.RE

.SH OUTPUT
.sp
.LP
The following list defines the column headings and the meanings of a
\fBctwatch\fR report:
.sp
.ne 2
.na
\fBCTID\fR
.ad
.RS 11n
The contract \fBID\fR generating the event.
.RE

.sp
.ne 2
.na
\fBEVID\fR
.ad
.RS 11n
The event \fBID\fR.
.RE

.sp
.ne 2
.na
\fBCRIT\fR
.ad
.RS 11n
Whether the event is informative, critical, or initiates an exit negotiation.
Values are \fBinfo\fR, \fBcrit\fR, or \fBneg\fR, respectively.
.RE

.sp
.ne 2
.na
\fBACK\fR
.ad
.RS 11n
The event has been acknowledged. Values are \fByes\fR or "\fBno\fR".
.RE

.sp
.ne 2
.na
\fBCTTYPE\fR
.ad
.RS 11n
The contract type.
.RE

.sp
.ne 2
.na
\fBSUMMARY\fR
.ad
.RS 11n
A type-specific summary of the event.
.RE

.SH EXAMPLES
.LP
\fBExample 1 \fRWatching a process contract
.sp
.in +2
.nf
example% \fBctwatch -r 1\fR

CTID    EVID    CRIT ACK CTTYPE  SUMMARY
1       2       crit no  process pid 100569 was created
1       3       info no  process pid 100569 encountered hardware error
1       4       info no  process pid 100568 exited
1       5       info no  process pid 100569 exited
1       6       crit no  process contract empty
.fi
.in -2
.sp

.SH EXIT STATUS
.sp
.LP
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 5n
Successful completion.
.RE

.sp
.ne 2
.na
\fB\fB1\fR\fR
.ad
.RS 5n
An error occurred.
.RE

.sp
.ne 2
.na
\fB\fB2\fR\fR
.ad
.RS 5n
Invalid arguments.
.RE

.SH FILES
.sp
.LP
\fB/system/contract/*\fR
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	See below.
.TE

.sp
.LP
Human Readable Output is Unstable. Invocation is Evolving.
.SH SEE ALSO
.sp
.LP
.BR ctrun (1),
.BR ctstat (1),
.BR contract (5),
.BR process (5),
.BR attributes (7),
.BR privileges (7)
.SH NOTES
.sp
.LP
Ordering of events is only guaranteed within a single contract, or within a
single type when a type is specified.
.sp
.LP
\fBctwatch\fR can only observe those events which are generated by contracts
owned or authored by processes with the same effective user ID as
\fBctwatch\fR, unless the \fB{PRIV_CONTRACT_OBSERVER}\fR privilege is asserted
in its effective set.
